import sdk from "@/store/http/sdkPost";

export default {
	async getDetailShow(params) {
		const result = await sdk.admPost(params, "graph_template/detail_show");
		return result;
	},
	// 1.设备类型树
	async getTypeTree() {
		var result = await sdk.admGet({}, "graph_common/typeTree");
		return result;
	},
	async getTypeTreeForLegend() {
		var result = await sdk.admGet({}, "graph_common/typeTreeForLegend");
		return result;
	},
	// 小附件类型树
	async getAttachTypeList() {
		var result = await sdk.admGet({}, "graph_common/attachTypeList");
		return result;
	},

	// 2.指定设备类型编码查询图例列表
	async selectGraphLegend(params) {
		var result = await sdk.admPost(params, "graph_legend/select");
		return result;
	},

	// 3.添加图例
	async insertGraphLegend(params) {
		var result = await sdk.admPost(params, "graph_legend/insert");
		return result;
	},

	// 4.删除图例
	async deleteGraphLegend(params) {
		var result = await sdk.admPost(params, "graph_legend/delete");
		return result;
	},

	// 5.修改图例
	async updateGraphLegend(params) {
		var result = await sdk.admPost(params, "graph_legend/update");
		return result;
	},

	//创建模版
	async insertTemplate(params) {
		const result = await sdk.admPost(params, "graph_template/insert");
		return result;
	},

	//专业列表
	async getMajorList() {
		const result = await sdk.admGet({}, "graph_common/majorList");
		return result;
	},
	//查询关系图类
	async getGrapType(params) {
		const result = await sdk.admPost(params, "graph_type/select");
		return result;
	},
	//添加关系图类
	async insertGrapType(params) {
		const result = await sdk.admPost(params, "graph_type/insert");
		return result;
	},
	//查询关系图子类
	async getGraphSubType(params) {
		const result = await sdk.admPost(params, "graph_sub_type/select");
		return result;
	},
	//添加关系图子类
	async insertGrapSubType(params) {
		const result = await sdk.admPost(params, "graph_sub_type/insert");
		return result;
	},

	//查询设备之间的关系类型
	async getClassCode(params) {
		const result = await sdk.admPost(params, "graph_common/relFromToClassCode");
		return result;
	},
	async getOnlyClassCode(params) {
		const result = await sdk.admPost(params, "graph_common/relOfClassCode");
		return result;
	},
	//查询可以链接的设备
	async getClassCodeList(params) {
		const result = await sdk.admPost(params, "graph_common/relClassCodeList");
		return result;
	},

	// 3.查询设备信息点定义
	async getDef_funcid(params) {
		const result = await sdk.admPost(params, "graph_common/def_funcid");
		return result;
	},
	// 6.1.1.实例化布局-查询
	async getInstantiationDetail(params) {
		const result = await sdk.admPost(params, "graph_template/detail_show");
		return result;
	},
	// 6.1.2.实例化布局-修改
	async instantiationDetailModify(params) {
		const result = await sdk.admPost(params, "graph_template/detail_modify");
		return result;
	},
	// 6.2.1.锚点文本-查询
	async getAnchorsTexts(params) {
		const result = await sdk.admPost(params, "graph_template/detail_show");
		return result;
	},
	// 6.2.2.文本- 修改
	// "operate": "text"
	async textsModify(params) {
		const result = await sdk.admPost(params, "graph_template/detail_modify");
		return result;
	},
	// 6.2.2.锚点线-修改
	// "operate": "line_insert", line_insert是插入，line_update是修改，line_delete是删除（此时只需要设置id）
	async anchorsModify(params) {
		const result = await sdk.admPost(params, "graph_template/detail_modify");
		return result;
	},

	// 6.5.1.锚点详情-查询
	async getAnchorDetail(params) {
		const result = await sdk.admPost(params, "graph_template/detail_show");
		return result;
	},
	// 6.5.2.锚点详情-修改
	async anchorDetailModify(params) {
		const result = await sdk.admPost(params, "graph_template/detail_modify");
		return result;
	},

	async getAttachDetail(params) {
		const result = await sdk.admPost(params, "graph_template/detail_show");
		return result;
	},

	// //实例化
	// async instantiationLoad(params) {
	// 	const result = await sdk.admPost(
	// 		params,
	// 		"/graph_generate/load?groupCode=TYXM&projectId=Pj9909990006&userId=abc"
	// 	);
	// 	return result;
	// },
	// 画布实例化
	async instantiationLoad(params, query) {
		var result = await sdk.admPost(params, "graph_generate/load?groupCode=" + query.groupCode + "&env=" + query.env + "&projectId=" + query.projectId + "&userId=abc&" + "rwd=" + query.rwd);
		return result;
	},
	// 实例化-查询环境列表
	async instantiationEnv() {
		const result = await sdk.admGet({}, "graph_generate/env");
		return result;
	},
	// 实例化-项目实例列表 专业列表
	async projectList(query) {
		const result = await sdk.admGet({}, "graph_generate/projectList?userId=abc&env=" + query.env);
		return result;
	},
	//查询基准对象
	async queryObjectList(params, query) {
		const result = await sdk.admPost(params, "/graph_common/queryObjectList?groupCode=" + query.groupCode + "&projectId=" + query.projectId + "&env=" + query.env + "&userId=abc");
		return result;
	},

	// 图例使用情况  WYF
	async queryLegendUsed(params) {
		const result = await sdk.admPost(params, "graph_legend/use");
		return result;
	},

	// 字典版本
	async getDicVersion() {
		const result = await sdk.admGet({}, "/graph_template/dic_version_curr");
		return result;
	},
	async getDicVersionList() {
		const result = await sdk.admGet({}, "/graph_template/dic_version_list");
		return result;
	},

	async dicVersionStateEdit(params) {
		const result = await sdk.admGet(params, "/graph_common/dicVersionStateEdit/" + params.dicVersion + "/" + params.serviceScopeState);
		return result;
	},

	async getPrintConfig(params) {
		const result = await sdk.admPost(params, "/graph_common/printConfig");
		return result;
	},

	async graphLegendSizeSelect() {
		const result = await sdk.admGet({}, "/graph_legend_size/select");
		return result;
	},

	async graphLegendSizeInsert(params) {
		const result = await sdk.admPost(params, "/graph_legend_size/insert");
		return result;
	},

	async graphLegendSizeDelete(params) {
		const result = await sdk.admPost(params, "/graph_legend_size/delete");
		return result;
	},
	async graphCommonRelTree(params) {
		const result = await sdk.admPost(params, "/graph_common/relTree", params);
		return result;
	},

	// 查询关系图类
	async graphTypeList(params) {
		const result = await sdk.admGet({}, "/graph_generate/graphTypeList");
		return result;
	},
	// 查询基准对象类型
	async referenceObjectTypeList(params) {
		const result = await sdk.admPost(params, "/graph_generate/referenceObjectTypeList");
		return result;
	},
	// 查询模版
	
	async getTemplate(params,query) {
		const result = await sdk.admPost(params, "/graph_generate/getTemplate?groupCode=" + query.groupCode + "&projectId=" + query.projectId + "&env=" + query.env + "&userId=abc"+ "&rwd=" + query.rwd);
		return result;
	},
};
